package cart.service;

import cart.vo.CartInfo;
import cart.vo.CartItem;
import cart.vo.CartTemp;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface CartService {
    CartInfo addToCart(Long skuId, Integer skuNum, HttpServletRequest request);

    /**
     * 获取购物车
     *
     * @param request
     * @return
     */
    CartTemp getCart(HttpServletRequest request);

    /**
     * 删除购物车中的商品项
     *
     * @param skuId
     * @param request
     */
    void deleteCartInfo(Long skuId, HttpServletRequest request);

    /**
     * 切换商品项选中状态
     *
     * @param skuId
     * @param isChecked
     * @param request
     */
    void checked(Long skuId, Integer isChecked, HttpServletRequest request);

    /**
     * 获取购物车中的商品项
     *
     * @param skuId
     * @param request
     * @return
     */
    CartInfo getCartItem(Long skuId, HttpServletRequest request);

    /**
     * 获取购物车所有被选中的商品
     *
     * @return
     */
    List<CartInfo> getCheckedCart(String token);
}
